import datetime


class TimeClass:

    @staticmethod
    def get_current_date_str():
        '''
        获取当前日期字符串
        :return:
        '''
        now_time = datetime.datetime.now()
        now_time_str = now_time.strftime("%Y%m%d")
        return now_time_str

    @staticmethod
    def get_current_datetime_str():
        '''
        获取当前日期时间字符串
        :return:
        '''
        now_time = datetime.datetime.now()
        now_time_str = now_time.strftime("%Y-%m-%d %H:%M:%S")
        return now_time_str

    @staticmethod
    def get_str_by_datetime(a_datetime):
        '''
        获取日期字符串
        :param datetime:
        :return:
        '''
        time_str = a_datetime.strftime("%Y-%m-%d %H:%M:%S")
        return time_str
